package com.example.shushiyunsst.fragment.main.home.child.bean;

import android.text.TextUtils;

import com.alibaba.fastjson.annotation.JSONField;
import com.example.library_common.global.AppGlobals;
import com.example.shushiyunsst.R;

import java.io.Serializable;
import java.util.List;

import static com.example.wallet.utils.IconUtilKt.selectorIcon;

public class IconNodeBean implements Serializable {

    public static final String sst = AppGlobals.getApplication().getString(R.string.wallet_sst);

    public static final String cml = AppGlobals.getApplication().getString(R.string.wallet_cml);

    public static final String icon = selectorIcon();

    /**
     * totalIncome : 1.5
     * nodeIncome : 0
     * fensi : 2
     * shiming : 3
     * chibi : 1
     * shimingAndChibi : 1
     * totalNums : 6
     * fensiToday : 0
     * shimingToday : 0
     * chibiToday : 0
     * destoryLog : [{"dbId":null,"tokenType":"CML","txNums":null,"walletAddress":"0x1ccdcf9f51a999ad56be19a0451863659189afbf","desType":4,"updateTime":null},{"dbId":null,"tokenType":"CML","txNums":null,"walletAddress":"0x2a7d4897123e89fc9f680e0887d9822f3702c38d","desType":1,"updateTime":null},{"dbId":null,"tokenType":"CML","txNums":null,"walletAddress":"0x98d9a468ca356dc65ed4f53c8d66bec21f16354a","desType":3,"updateTime":null},{"dbId":null,"tokenType":"CML","txNums":null,"walletAddress":"0xe7188cf96aa68117fb376a7512ffc56b5aef17c5","desType":2,"updateTime":null}]
     * totalDestroy : 1.19
     * todayDestroy : null
     */

    @JSONField(name = "totalIncome")
    private double totalIncome;

    //节点收益
    @JSONField(name = "nodeIncome")
    private double nodeIncome;

    @JSONField(name = "fensi")
    private double fensi;

    @JSONField(name = "shiming")
    private double shiming;

    @JSONField(name = "chibi")
    private double chibi;

    @JSONField(name = "shimingAndChibi")
    private double shimingAndChibi;

    @JSONField(name = "totalNums")
    private double totalNums;

    //今日新增粉丝
    @JSONField(name = "fensiToday")
    private double fensiToday;

    @JSONField(name = "shimingToday")
    private double shimingToday;

    //今日新增持币
    @JSONField(name = "chibiToday")
    private double chibiToday;

    //截止总销毁
    @JSONField(name = "totalDestroy")
    private double totalDestroy;

    @JSONField(name = "todayDestroy")
    private double todayDestroy;

    //当前节点级别
    @JSONField(name = "nodeLevel")
    private String nodeLevel;


    @JSONField(name = "destoryLog")
    private List<DestoryLogBean> destoryLog;

    //节点累计CML持有数量
    @JSONField(name = "totalChildCounts")
    private double totalChildCounts;

    //节点累计CML母币持有数量
    @JSONField(name = "totalMotherCounts")
    private double totalMotherCounts;

    //节点生息业绩累计
    @JSONField(name = "myTotalIncome")
    private double myTotalIncome;

    //最佳持证
    @JSONField(name = "bestHave")
    private double bestHave;

    //直推收益
    @JSONField(name = "mySpreadIncome")
    private double mySpreadIncome;

    //零售收益
    @JSONField(name = "myShareIncome")
    private double myShareIncome;

    @JSONField(name = "scmlPrice")
    private double scmlPrice;

    @JSONField(name = "sstBalance")
    private double sstBalance;

    //截止总挖出CML
    @JSONField(name = "totalCmlNums")
    private double totalCmlNums;

    //是否满足节点升级 1满足 0不满足
    @JSONField(name = "isNodeUpdate")
    private double isNodeUpdate;

    //已满足激活节点xx节点条件 xx取值为
    @JSONField(name = "nodeUpdateLevel")
    private String nodeUpdateLevel;

    public double getTotalCmlNums() {
        return totalCmlNums;
    }

    public String getTotalCmlNumsStr() {
        return totalCmlNums + "";
    }

    public void setTotalCmlNums(double totalCmlNums) {
        this.totalCmlNums = totalCmlNums;
    }

    public double getIsNodeUpdate() {
        return isNodeUpdate;
    }

    public boolean isNodeUpdate() {
        return isNodeUpdate == 1;
    }

    public void setIsNodeUpdate(double isNodeUpdate) {
        this.isNodeUpdate = isNodeUpdate;
    }

    public String getNodeUpdateLevel() {
        return nodeUpdateLevel;
    }

    public String getNodeUpdateLevelStr() {
        if (TextUtils.isEmpty(nodeUpdateLevel)) return "暂无可激活的节点";
        return isNodeUpdate() ? "已满足激活" + nodeUpdateLevel + "节点条件"
                : "未满足激活" + nodeUpdateLevel + "节点条件";
    }

    public void setNodeUpdateLevel(String nodeUpdateLevel) {
        this.nodeUpdateLevel = nodeUpdateLevel;
    }

    public String getSstBalanceStr() {
        return sstBalance + "";
    }

    public double getSstBalance() {
        return sstBalance;
    }

    public void setSstBalance(double sstBalance) {
        this.sstBalance = sstBalance;
    }

    public String getScmlPriceStr() {
        return scmlPrice + "";
    }

    public double getScmlPrice() {
        return scmlPrice;
    }

    public void setScmlPrice(double scmlPrice) {
        this.scmlPrice = scmlPrice;
    }

    public double getMyShareIncome() {
        return myShareIncome;
    }

    public String getMyShareIncomeStr() {
        return myShareIncome + "";
    }


    public void setMyShareIncome(double myShareIncome) {
        this.myShareIncome = myShareIncome;
    }

    public double getMySpreadIncome() {
        return mySpreadIncome;
    }

    public String getMySpreadIncomeStr() {
        return mySpreadIncome + "";
    }

    public void setMySpreadIncome(double mySpreadIncome) {
        this.mySpreadIncome = mySpreadIncome;
    }

    public double getMyTotalIncome() {
        return myTotalIncome;
    }

    public String getMyTotalIncomeStr() {
        return myTotalIncome + "";
    }


    public void setMyTotalIncome(double myTotalIncome) {
        this.myTotalIncome = myTotalIncome;
    }

    public double getBestHave() {
        return bestHave;
    }

    public String getBestHaveStr() {
        return bestHave + "";
    }

    public void setBestHave(double bestHave) {
        this.bestHave = bestHave;
    }

    public double getTotalChildCounts() {
        return totalChildCounts;
    }

    public String getTotalChildCountStr() {
        return totalChildCounts + "";
    }
    public void setTotalChildCounts(double totalChildCounts) {
        this.totalChildCounts = totalChildCounts;
    }

    public String getNodeLevel() {
        return nodeLevel;
    }

    public void setNodeLevel(String nodeLevel) {
        this.nodeLevel = nodeLevel;
    }

    public double getTotalMotherCounts() {
        return totalMotherCounts;
    }

    public String getTotalMotherCountStr() {
        return totalMotherCounts + "";
    }

    public void setTotalMotherCounts(double totalMotherCounts) {
        this.totalMotherCounts = totalMotherCounts;
    }

    public double getTotalIncome() {
        return totalIncome;
    }

    public String getTotalIncome22() {
        return totalIncome + "";
    }

    public String getTotalIncome22Title() {
        return AppGlobals.getApplication().getString(R.string.node_all_income_title, icon);
    }

    public void setTotalIncome(double totalIncome) {
        this.totalIncome = totalIncome;
    }

    public double getNodeIncome() {
        return nodeIncome;
    }

    public String getNodeIncome22() {
        return nodeIncome + "";
    }

    public String getNodeIncome22Title() {
//        return nodeIncome + "";
        return AppGlobals.getApplication().getString(R.string.node_income_title, icon);
    }


    public void setNodeIncome(double nodeIncome) {
        this.nodeIncome = nodeIncome;
    }

    public double getFensi() {
        return fensi;
    }

    public void setFensi(double fensi) {
        this.fensi = fensi;
    }

    public double getShiming() {
        return shiming;
    }

    public void setShiming(double shiming) {
        this.shiming = shiming;
    }

    public double getChibi() {
        return chibi;
    }

    public void setChibi(double chibi) {
        this.chibi = chibi;
    }

    public double getShimingAndChibi() {
        return shimingAndChibi;
    }

    public void setShimingAndChibi(double shimingAndChibi) {
        this.shimingAndChibi = shimingAndChibi;
    }

    public double getTotalNums() {
        return totalNums;
    }

    public String getTotalNums22() {
        return ((int) totalNums) + "";
    }

    public void setTotalNums(double totalNums) {
        this.totalNums = totalNums;
    }

    public double getFensiToday() {
        return fensiToday;
    }

    public String getFensiToday22() {
        return fensiToday + "";
    }

    public void setFensiToday(double fensiToday) {
        this.fensiToday = fensiToday;
    }

    public double getShimingToday() {
        return shimingToday;
    }

    public String getShimingToday22() {
        return shimingToday + "";
    }

    public void setShimingToday(double shimingToday) {
        this.shimingToday = shimingToday;
    }

    public double getChibiToday() {
        return chibiToday;
    }

    public String getChibiToday22() {
        return chibiToday + "";
    }

    public void setChibiToday(double chibiToday) {
        this.chibiToday = chibiToday;
    }

    public double getTotalDestroy() {
        return totalDestroy;
    }

    public String getTotalDestroy22() {
        return totalDestroy + "";
    }

    public String getTotalDestroy22Title() {
        return AppGlobals.getApplication().getString(R.string.node_today_destroy_title, icon);
    }

    public void setTotalDestroy(double totalDestroy) {
        this.totalDestroy = totalDestroy;
    }

    public double getTodayDestroy() {
        return todayDestroy;
    }

    public String getTodayDestroy22() {
        return todayDestroy + "";
    }

    public void setTodayDestroy(double todayDestroy) {
        this.todayDestroy = todayDestroy;
    }

    public List<DestoryLogBean> getDestoryLog() {
        return destoryLog;
    }

    public void setDestoryLog(List<DestoryLogBean> destoryLog) {
        this.destoryLog = destoryLog;
    }

    public static class DestoryLogBean implements Serializable {

        /**
         * tokenType : ARL
         * totalTxNums : 1.17
         * walletAddress : 0x2a7d4897123e89fc9f680e0887d9822f3702c38d
         * desType : 1
         * desTypeDesc : 旷工销毁
         */

        @JSONField(name = "tokenType")
        private String tokenType;

        @JSONField(name = "totalTxNums")
        private double totalTxNums;

        @JSONField(name = "walletAddress")
        private String walletAddress;

        @JSONField(name = "desType")
        private int desType;

        @JSONField(name = "desTypeDesc")
        private String desTypeDesc;

        public String getTokenType() {
            return tokenType;
        }

        public void setTokenType(String tokenType) {
            this.tokenType = tokenType;
        }

        public double getTotalTxNums() {
            return totalTxNums;
        }

        public void setTotalTxNums(double totalTxNums) {
            this.totalTxNums = totalTxNums;
        }

        public String getWalletAddress() {
            return walletAddress;
        }

        public void setWalletAddress(String walletAddress) {
            this.walletAddress = walletAddress;
        }

        public int getDesType() {
            return desType;
        }

        public void setDesType(int desType) {
            this.desType = desType;
        }

        public String getDesTypeDesc() {
            return desTypeDesc;
        }

        public void setDesTypeDesc(String desTypeDesc) {
            this.desTypeDesc = desTypeDesc;
        }
    }
}
